<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
         //设置变量接收用户输入年份
        let nian = prompt('请随便输入一个年份')
        //判断一下是什么年份
        if ((nian % 4 === 0 && nian % 100 !== 0) || nian % 400 === 0) {
            alert('闰年')
        } else {
            alert('平年')
        }
    </script>
</body>

</html>